package com.lizicloud.user.userupdate.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 用户实体类 - 用户更新模块专用
 * 映射数据库中的user表
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("user")
@Schema(description = "用户实体")
public class User implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    @TableId(type = IdType.AUTO)
    @Schema(description = "用户ID")
    private Long id;
    
    @TableField("useraccount")
    @Schema(description = "用户账号")
    private String useraccount;
    
    @TableField("username")
    @Schema(description = "用户名")
    private String username;
    
    @TableField("password")
    @Schema(description = "密码")
    private String password;
    
    @TableField("email")
    @Schema(description = "邮箱地址")
    private String email;
    
    @TableField("phone")
    @Schema(description = "手机号码")
    private String phone;
    
    @TableField("avatar")
    @Schema(description = "头像URL")
    private String avatar;
    
    @TableField("role")
    @Schema(description = "用户角色")
    private String role;
    
    @TableField("status")
    @Schema(description = "状态：1-启用，0-禁用")
    private Integer status;
    
    @TableField("remark")
    @Schema(description = "备注信息")
    private String remark;
    
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    private LocalDateTime createdTime;
    
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间")
    private LocalDateTime updatedTime;
    
    @TableLogic
    @TableField(value = "is_delete", fill = FieldFill.INSERT)
    @Schema(description = "逻辑删除：0-未删除，1-已删除")
    private Integer isDelete;
}